#ifndef RIVER_H
#define RIVER_H

#include <SFML/Graphics.hpp>

using namespace sf;

const Vector2i directions[9] { Vector2i(-1,-1),     // North West
                               Vector2i(0, -1),     // North
                               Vector2i(1, -1),     // North East
                               Vector2i(-1, 0),     // West
                               Vector2i(0,  0),     // -
                               Vector2i(1,  0),     // East
                               Vector2i(-1, 1),     // South West
                               Vector2i(0,  1),     // South
                               Vector2i(1,  1)};    // South East

struct RiverSettings
{
    double *watermap;
    double *normalizedHeightmap;
    double *displayWatermap;
    Vector2i position;
    int riverCoordMod;
    int mapSize;
};

class River
{
    public:
        River(RiverSettings settings);
        Vector2i getPos() { return position; }
        void setPos(Vector2i p) { position = p; }
        void addDirection(char direction) { path.push_back(direction); }
        void flow();
        std::vector<char>* getPath() { return &path; }
        int stepBack();
    protected:
    private:
        Vector2i position;
        std::vector<char> path;

        double *watermap;
        double *normalizedHeightmap;
        double *displayWatermap;

        int riverCoordMod;
        int mapSize;
};

#endif // RIVER_H
